<template>
  <view class="innerContain">
    <view class="top-content">
      <view class>
        <!-- <u-calendar v-model="show" @change="timechange" mode="date"></u-calendar> -->
      </view>
    </view>
    <view class="topradio">
      <view class="top">
        <table
          border="1"
          width="100%"
          cellspacing="0"
          cellpadding="0"
          style="table-layout: fixed;border-collapse: collapse;"
        >
          <tr class="titleTd">
            <td>客户名称</td>
            <td>项目名称</td>
            <td>合同号</td>
            <td>产品数量</td>
          </tr>
          <tr v-if="datalist.length<1">
            <td colspan="4">暂无数据</td>
          </tr>
          <tr v-else v-for="(item,index) in datalist " :key="index">
            <td style="word-wrap:break-word;">{{item.deptName}}</td>
            <td style="word-wrap:break-word;">{{item.projectName}}</td>
            <td style="word-wrap:break-word;">{{item.projectCode}}</td>
            <td style="word-wrap:break-word;">{{item.deviceNum}}</td>
          </tr>
        </table>
      </view>
      <view style="height:20rpx"></view>
    </view>
  </view>
</template>

<script>
import { saleGather } from '@/api/index.js'
export default {
  onLoad(val) {
    this.id = val.id
    uni.showLoading({
      title: '加载中'
    })
    this.timeone = val.timeone
    this.hour = val.hour
    this.minute = val.minute
    this.second = val.second
    this.hourarr = this.hour + ':' + this.minute + ':' + this.second
  },
  onUnload() {
    plus.screen.lockOrientation('portrait-primary')
  },
  onBackPress(e) {
    if (e.from == 'backbutton') {
      //  console.log(11111111111111111111111)
      uni.navigateTo({
        url: '../preview/blank'
      })
      return true
    }
  },
  onShow() {
     plus.screen.lockOrientation('landscape-primary');
    switch (uni.getSystemInfoSync().platform) {
      case 'android':
        this.hanldeFont()
        console.log('运行Android上')
        break
      case 'ios':
        this.hanldeFont()
        console.log('运行iOS上')
        break
      default:
        this.hanldeFonts()
        console.log('运行在开发者工具上')
        break
    }
    this.getList()
    this.date = this.timeone
    this.current = 0
    uni.hideLoading()
  },
  onUnload() {
    plus.screen.lockOrientation('portrait-primary')
  },
  data() {
    return {
      orrerdatalist: [],
      dataarr: [],
      iconType: 'flower',
      show: true,
      loadmore: '暂无数据',
      loadText: {
        loadmore: '暂无数据',
        loading: '努力加载中',
        nomore: '没有更多数据',
        data: '暂无数据'
      },
      mode: 'date',
      show: false,
      date: '',
      height: 0,
      height2: 0,
      height3: 0,
      height4: 0,
      height5: 0,
      height6: 0,
      height7: 0,
      image: '../../static/images/1.jpg',
      form: {},
      form1: [{}, {}, {}, {}, {}],
      form2: [{}, {}, {}],
      form3: [{}, {}, {}],
      form4: [{}, {}, {}, {}],
      form5: {},
      descriptionVOS: [],
      taskDealVOS: [],
      taskDealVOS1: [],
      descriptionVOS1: [],
      tableone: false,
      list: [
        {
          number: 1,
          name: '波纹管',
          content: [
            {
              value: '裂纹',
              checked: "'false'"
            },
            {
              value: '腐蚀',
              checked: "'false'"
            },
            {
              value: '泄漏',
              checked: "'false'"
            },
            {
              value: '异常变形',
              checked: "'false'"
            },
            {
              value: '其他问题',
              checked: "'false'"
            }
          ]
        },
        {
          number: 2,
          name: '承力承受件',
          content: [
            {
              value: '焊缝',
              checked: "'false'"
            },
            {
              value: '大变形',
              checked: "'false'"
            },
            {
              value: '其他问题',
              checked: "'false'"
            }
          ]
        },
        {
          number: 3,
          name: '附属件',
          content: [
            {
              value: '脱落',
              checked: "'false'"
            },
            {
              value: '干涉',
              checked: "'false'"
            },
            {
              value: '其他问题',
              checked: "'false'"
            }
          ]
        },
        {
          number: 4,
          name: '工况记录',
          content: [
            {
              value: '温度(℃)',
              checked: "'false'"
            },
            {
              value: '压力(MPa)',
              checked: "'false'"
            },
            {
              value: '运行周期(次)',
              checked: "'false'"
            },
            {
              value: '振动频率(HZ)',
              checked: "'false'"
            }
          ]
        }
      ],
      datalist: [],
      datatimelist: [],
      excludedatalist: [],
      timedatalist: [],
      hourarr: '',
      current: 0,
      tableshow: false
    }
  },
  methods: {
    getList() {
      // uni.showLoading({
      //   title: "加载中"
      // });
      const data = {}
      // console.log('aaaaaaaaaaaaaaaaaaaaaa')
      saleGather(data).then(res => {
        console.log(res.data)
        this.datalist = res.data
         if(this.datalist ==undefined){
          this.datalist=[]
        }
        uni.hideLoading()
      })
    },
    hanldeFont() {
      // const url = '../../static/fonts/Pacifico.ttf'
      uni.loadFontFace({
        family: 'sonti', // 这里是字体的名字
        // 本地字体路径需转换为平台绝对路径
        // source: `url(${plus.io.convertLocalFileSystemURL('_www/static/fonts/Pacifico.ttf')})`,
        // #ifdef APP-PLUS

        source: `url(${plus.io.convertLocalFileSystemURL(
          '_www/static/fonts/sonti.ttf'
        )})`,
        // #endif
        // source: `url("${url}")`,
        success() {
          console.log('success')
        },
        fail(e) {
          console.log('fail')
        }
      })
    },
    hanldeFonts() {
      const url = '../../static/fonts/sonti.ttf'
      uni.loadFontFace({
        family: 'sonti', // 这里是字体的名字
        // 本地字体路径需转换为平台绝对路径
        // source: `url(${plus.io.convertLocalFileSystemURL('_www/static/fonts/Pacifico.ttf')})`,
        // source: `url(${plus.io.convertLocalFileSystemURL(
        //   '_www/static/fonts/FZFSJW.ttf'
        // )})`,

        source: `url("${url}")`,
        success() {
          console.log('success')
        },
        fail(e) {
          console.log('fail')
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
/deep/ table {
  border-color: #3784f0;
}
.titleTd {
  td {
    color: #1040be;
    font-weight: 600;
  }
}
// @font-face {
//   font-family: 'souti';
//   src: url('../../static/fonts/sonti.ttf') format('truetype');
// }
h3 {
  font-family: sonti;
}
// view{
//    font-family: sonti;
// }
tr,
td {
  // font-family: FZFSJW;
  font-family: sonti;
  // font-family: FangSong;
}
th {
  font-weight: 500;
}

uni-view {
  font-size: 14px;
}
.vtable {
  text-align: center;
  width: 100%;
  padding: 10rpx 20rpx 20rpx 20rpx;
}
thead {
  th {
    font-weight: 500;
    text-align: center;
  }
}
tbody {
  td {
    text-align: center;
  }
}
.flex {
  display: flex;
  justify-content: center;
}
.text-c {
  th {
    width: 400rpx;
  }
}
.title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  view {
    width: 30%;
  }
  .span {
    height: 100%;
    border: 1px solid #333;
  }
  .text {
    display: flex;
    view {
      flex: 1;
    }
    uni-input {
      height: 100%;
      border-left: 1px solid;
      border-right: 1px solid;
    }
  }
}
.last {
  display: flex;
  view {
    flex: 1;
  }
}
.vtitle {
  font-weight: 600;
}
image {
  width: 50rpx;
  height: 50rpx;
}
.check {
  border-bottom: 2px solid #333;
  width: 105%;
  margin-right: 20px;
}
.talbeborder {
  border: 1px solid;
}
.titlechild {
}
.ttitle {
  font-size: 20px;
  font-weight: 600;
}
.date {
  z-index: 9999;
  position: absolute;
  top: -80rpx;
  right: 10rpx;
  margin-right: 10rpx;
  display: flex;
  align-items: center;
  .image {
    position: absolute;
    width: 28rpx;
    height: 34rpx;
    left: 20rpx;
    // height: 80upx;
  }
  /deep/ .u-size-default {
    padding: 18rpx 24rpx 18rpx 50rpx;
  }
  /deep/ .u-mode-plain-primary {
    border: 1px solid #eee;
    box-shadow: 0 0 20rpx #eee;
    border-radius: 16rpx;
    color: #989898;
  }
}
.ttitle1 {
  position: fixed;
  bottom: 0rpx;
}
.title2 {
  height: calc(100% - 140upx);
}
.k-line {
  display: lnline-block;
  width: 15px;
  height: 15px;
  border-radius: 15px;
  margin-top: 20px;
}
@keyframes k-loadingA {
  50% {
  }
}
.innerContain {
  height: 100%;
  text-align: center;
  position: relative;
  background-color: white;
}
.top-content {
  height: 360upx;
  // background: linear-gradient(to left, #1040be, #026dff);
}
.top {
  // height: calc(100% - 50rpx);
  margin: 0rpx;
  overflow-y: auto;
  position: absolute;
  // background-color: white;
  background: rgb(244, 249, 250);
  padding: 50rpx;
  width: 100%;
  // box-shadow: 4rpx 4rpx 20rpx #e5e1e1;
  top: 30rpx;
  border-radius: 40rpx 40rpx 0 0;
  .card {
    // background-color: white;
    border: 1px solid #eee;
    padding: 20rpx 20rpx;
    border-radius: 25rpx;
    box-shadow: 0 0 20rpx #eee;
    margin-bottom: 20rpx;
  }
}
/deep/ .uni-view {
  font-size: 0px;
}
.titlechild {
  margin-top: -10rpx;
}
/deep/ .u-line-1 {
  height: 60rpx !important;
}
.border {
  font-family: SimSun;
  margin-left: 20rpx;
  padding: 15rpx 5rpx;
  // box-shadow: 0 0 20rpx #eee;
  border: 1px solid rgb(180, 175, 175);
  border-radius: 16rpx;
  color: #eee;
}
/deep/ .video-del {
  display: none;
}
/deep/ .u-scroll-box {
  font-family: SimSun;
}
/deep/ .u-drawer-content-visible {
  height: 80% !important;
}
</style>
